<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include/taglibs.jsp"%>
<script type="text/javascript">

$(document).ready(function(){

});

//데이터 저장
function submitData(){
	if(confirm("등록하시겠습니까?")){
		$("#frmData").submit();	
	}
	
}

//데이터 삭제  
function deleteData(no){
	if(confirm("삭제하시겠습니까?")){
		location.href="./peti601T.do?p_id=${map.p_id}&sc_no="+no;	
	}
	
}

//기본요금 변경
function setBasePay(sms_pay){
	if(confirm("요금을 변경하시겠습니까?")){
		location.href="./peti602T.do?p_id=${map.p_id}&sms_pay="+$("#sms_pay").val();	
	}
}

//요금 설정 구매
function setMoney(type,val){
	if(type==1){
		$('#sc_pay').val($(val).val()*$('#sms_pay').val());
	}else{
		$('#sc_cnt').val($.frp($(val).val()/$("#sms_pay").val(),0));
	}
}

//수정
function updateData(id){
	if(confirm("수정하시겠습니까?")){
		$("#"+id).submit();	
	}
	
}

//삭제
function deleteData(no){
	if(confirm("삭제하시겠습니까?")){
		location.href="./peti702T.do?p_id=${map.p_id}&as_no="+no;	
	}
}
</script>

<%@ include file="/WEB-INF/jsp/pmgr/pe/ti/page_top.jsp"%>



<form action="./peti700T.do" method="post" id="frmData">
		<input type="hidden" name="p_id" value="${param.p_id }">
		
<table width="700" >
<tr>
	<td align="left"><b>등록하기</b></td>
	<td align="right">&nbsp;</td>
</tr>
</table>
		<table width="700" border="0"  cellspacing="1" cellpadding="2" class="class_admin_table">

		<tr> 
			<td height="25" class="class_admin_table_head" width="130" align="center">부가서비스명</td>
			<td height="25" class="class_admin_table_blank">&nbsp;&nbsp; <input type="text" name="as_nm" maxlength="30" size="30" value=""></td>
			<td height="25" class="class_admin_table_head" width="130" align="center">가격</td>
			<td height="25" class="class_admin_table_blank">&nbsp;&nbsp; <input type="text" name="as_pay" maxlength="10" size="10" value=""></td>
		</tr>
		<tr> 
			<td height="25" class="class_admin_table_head" width="130" align="center">요구사항문구</td>
			<td height="25" class="class_admin_table_blank">&nbsp;&nbsp; <input type="text" name="as_req_memo" maxlength="50" size="30" value=""></td>

			<td height="25" class="class_admin_table_head" width="130" align="center">단위</td>
			<td height="25" class="class_admin_table_blank">&nbsp;&nbsp; <input type="text" name="as_unit" maxlength="10" size="10" value="회"></td>
		</tr>
				<tr> 
					<td height="25" class="class_admin_table_head" width="50" align="center">사용</td>
					<td height="25" class="class_admin_table_blank" colspan="3">
					
						<label><input name="del_yn" value="N" type="radio" checked="checked" />사용</label>
						<label><input name="del_yn" value="Y" type="radio" />미사용</label>
					</td>
				</tr>
		<tr> 
			<td height="25" class="class_admin_table_head" width="130" align="center">설명</td>
			<td height="25" class="class_admin_table_blank" colspan="3"><center><textarea name="as_desc" rows="5" cols="90"></textarea></center></td>
		</tr>
		</table>
		<table width="700">
		<tr>
			<td><center><input type="button" onclick="submitData();" value=" 추 가 "></center></td>
		</tr>
		</table>

</form>




<br>
<table width="700" >
<tr>
	<td align="left"><b>부가서비스</b></td>
	<td align="right">&nbsp;</td>
</tr>
</table>


		<table width="700" border="0"  cellspacing="1" cellpadding="2" class="class_admin_table">
		<tr height="25" class="class_admin_table_head">
			<td align="center" width="50">사용</td>
			<td align="center" width="*">내용</td>
			<td align="center" width="50">관리</td>
		</tr>
<c:if test="${list !=null && fn:length(list)>0 }">
	<c:forEach var="map1" items="${list}" varStatus="status">
		<form id="frmData${status.index }" method="post" action="./peti701T.do">
		<input name="p_id" value="${map1.p_id }" type="hidden"/>
		<input name="as_no" value="${map1.as_no }" type="hidden"/>
		<tr class="class_admin_table_blank">
			<td>
			${status.count }
			</td>
			<td>
				<table width="600" border="0"  cellspacing="1" cellpadding="2" class="class_admin_table">
		
				<tr> 
					<td height="25" class="class_admin_table_head" width="100" align="center">부가서비스명</td>
					<td height="25" class="class_admin_table_blank" width="300" > <input type="text" name="as_nm" maxlength="30" size="30" value="${map1.as_nm }"></td>
					<td height="25" class="class_admin_table_head" width="50" align="center">가격</td>
					<td height="25" class="class_admin_table_blank"> <input type="text" name="as_pay" maxlength="10" size="10" value="${map1.as_pay }"></td>
				</tr>
				<tr> 
					<td height="25" class="class_admin_table_head" width="100" align="center">요구사항문구</td>
					<td height="25" class="class_admin_table_blank" width="300" > <input type="text" name="as_req_memo" maxlength="50" size="30" value="${map1.as_req_memo }"></td>
		
					<td height="25" class="class_admin_table_head" width="50" align="center">단위</td>
					<td height="25" class="class_admin_table_blank"><input type="text" name="as_unit" maxlength="10" size="10" value="${map1.as_unit }"></td>
				</tr>
				<tr> 
					<td height="25" class="class_admin_table_head" width="100" align="center">등록일</td>
					<td height="25" class="class_admin_table_blank" width="300" > ${map1.reg_dt_n }</td>
		
					<td height="25" class="class_admin_table_head" width="50" align="center">사용</td>
					<td height="25" class="class_admin_table_blank">
						<label><input name="del_yn" value="N" type="radio" <c:if test="${map1.del_yn!='Y' }">checked="checked"</c:if>/>사용</label>
						<label><input name="del_yn" value="Y" type="radio" <c:if test="${map1.del_yn=='Y' }">checked="checked"</c:if> />미사용</label>
					</td>
				</tr>
				<tr> 
					<td height="25" class="class_admin_table_head" width="100" align="center">설명</td>
					<td height="25" class="class_admin_table_blank" colspan="3"><center><textarea name="as_desc" rows="5" cols="70">${map1.as_desc }</textarea></center></td>
				</tr>
				</table>
			</td>
			<td>
				<input type="button" onclick="updateData('frmData${status.index }');" value=" 수 정 "> 
				<input type="button" onclick="deleteData('${map1.as_no}');" value=" 삭 제 "> 
			</td>
		</tr>	
		</form>
	</c:forEach>
</c:if>

		</table>
	

<table width="700" border="0"  cellspacing="1" cellpadding="2" class="class_admin_table_nocolor">
<tr> 
	<td height="25"  align="center">
		<input type="button" onclick="location.href='peti100Q.do'" value=" 펜 션 목 록 "> 
	</td>
</tr>

</table>	

